//
//  ViewController.m
//  CoreDataDemo
//
//  Created by liuxiang on 2018/1/5.
//  Copyright © 2018年 liuxiang. All rights reserved.
//

#import "ViewController.h"
#import "CoreDataManager.h"
#import "CoreDataBookImp.h"
#import "BcBook+CoreDataProperties.h"
#import <CoreData/CoreData.h>

@interface ViewController ()<UITableViewDelegate, UITableViewDataSource, NSFetchedResultsControllerDelegate>

@property (strong, nonatomic) UITableView *tableView;

@property (strong, nonatomic) NSFetchedResultsController *fetchResult;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    [[CoreDataManager sharedCoreDataManager] insertDataFromSql];
    
}

- (UITableViewCell *)  tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *cellReuseTableViewCell = @"cellIdentifier";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellReuseTableViewCell];
    if (cell == nil) {
       
    }
    return cell;
}

#pragma mark - getter
- (UITableView *) tableView {
    if (!_tableView) {
        _tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain];
        _tableView.delegate = self;
        _tableView.dataSource = self;
        
    }
    return _tableView;
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
